import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

/**
 * @Author: zhaobl
 * @Time: 2018/11/30 17:24
 * @Description:
 */
public class Index {
    public static void main(String[] args) {
        demo();
        //demo1();
        //demo2();
    }

    private static void demo()
    {
        Admin admin = ()->"张三";
        System.out.println(admin.getName());

        myName(()->"张三他老板");

    }

    private static void myName(Admin admin){
        String name = admin.getName();
        System.out.println(name);
    }


    private static void demo1()
    {
        Admin admin = new Admin() {
            @Override
            public String getName() {
                return "张三";
            }
        };
        System.out.println(admin.getName());
    }


    private static void demo2()
    {

        try(BufferedReader result = Files.newBufferedReader(Paths.get("./lambda/src/1.txt")))
        {
            String str = result.readLine() + result.readLine();
            System.out.println(str);
        }catch (Exception e){
            e.printStackTrace();
        }

        try(BufferedReader result = Files.newBufferedReader(Paths.get("./lambda/src/1.txt")))
        {
            ReadFile readFile = (r) -> r.readLine() + r.readLine();
            String str = readFile.read(result);
            System.out.println(str);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

}

interface ReadFile{
    String read(BufferedReader bufferedReader) throws IOException;
}
